<template>
    <div style="position: relative;">
        <div>
            <head-nav :firstTitle="'影像存档'" :subTitle="'影像列表'" :thirdTitle="'回收站'"></head-nav>
        </div>
        <div ref="tabHeight" class="ml20">
            <!--      <head-tab-switch navTitle="影像列表"/>-->
        </div>
        <div ref="condationHeight" class="ml10 mt5 mb">
            <condition-inquery :match_state="formData.match_state" :systemsLiteList="systemsLiteList"
                :room_ids="ObservationRoomIds" :clear_select="clear_select" @setMatchState="setMatchState" @reset="resetFn"
                @search="searchFn" @systemOrInstitutionChanged="systemOrInstitutionChanged"
                @recalculateTableHeight="recalculateTableHeight" @changeClear="changeClear" />
        </div>

        <div class="btnBox fr mb5 mt5 mr20">
            <el-button v-if="hasPerimission('yxsc')" @click="deleteFn" type="danger" plain class="ml10i"><i
                    class="iconfont mr5">&#xe682;</i>删除</el-button>
            <el-button @click="toImgList" type="primary" plain class="ml10i"><i
                    class="iconfont mr5">&#xe68d1;</i>返回</el-button>
        </div>

        <el-table :data="tableData" border ref="mytable" :header-cell-style="{ background: '#F5F5F5', color: '#333' }"
            :height="tableHeighth" highlight-current-row @row-click="handleCurrentChange" @select="tableSignleSelection"
            @select-all="tableAllSelection" @selection-change="tableSelectionChange" @header-dragend="tableHeaderDragend"
            :row-key="getRowKey" header-row-class-name="strong">

            <el-table-column fixed="left" type="selection" :reserve-selection="true"></el-table-column>
            <el-table-column label="序" width="55" fixed="left" align="center">
                <template slot-scope="scope">
                    {{ orderNum + 1 + scope.$index }}
                </template>
            </el-table-column>
            <el-table-column label="操作" width="60" fixed="left">
                <template slot-scope="scope">
                    <el-button class="clr_ff6f6f delete-btn" @click="singleDeleteFn(scope.row)" type="text">删除</el-button>

                </template>
            </el-table-column>
            <el-table-column label="匹配状态" width="100" prop="match_state" align="center" fixed="left">
                <template slot-scope="scope">
                    <div v-if="scope.row.match_state === 0">
                        <i class="inline w10 h10 bg9 bradius5 mr6"></i>
                        <span>未匹配</span>
                    </div>
                    <div v-if="scope.row.match_state === 10">
                        <i class="inline w10 h10 bg_ef8900 bradius5 mr6"></i>
                        <span>未摄片</span>
                    </div>
                    <div v-if="scope.row.match_state === 1">
                        <i class="inline w10 h10 bg_49b523 bradius5 mr6"></i>
                        <span>匹配成功</span>
                    </div>
                    <div v-if="scope.row.match_state === -1">
                        <i class="inline w10 h10 bg_ff6f6f bradius5 mr6"></i>
                        <span>匹配失败</span>
                    </div>
                </template>
            </el-table-column>

            <common-table :propData="propData"></common-table>
            <!-- <el-table-column fixed="right" align="right" width="50">
                <template slot="header">
                    <span class="el-icon-s-tools" @click="SetColumndShow = true"></span>
                </template>
            </el-table-column> -->
        </el-table>
        <!-- 分页 -->
        <div ref="paginationHeight">
            <pagination-tool :total="total" :page.sync="listQuery.page_index" :limit.sync="listQuery.page_size"
                @pagination="fecthTableData" />
        </div>

        <SetColumns :defaultColumn="defaultColumn" :SetColumndShow="SetColumndShow" @SetColumndBack="SetColumndBack"
      :owner="owner" />
        <!-- 删除患者影像 -->

        <div class="white-head">
            <el-dialog v-el-drag-dialog v-if="delDailog" title="" :visible.sync="delDailog" width="400px" top="31vh"
                :before-close="handleClose" :show-close="false">

                <div class="pt20">
                    <div class="content-title mb10"> <i class="iconfont clr_ef8900 f18 mr10">&#xe680;</i>
                        <span class="f18" v-if="moreDelOperate"> 批量</span>删除
                    </div>
                    <div class="pb10" style="border-bottom: 1px dashed #cccccc;" v-if="delObj.match_state === 1">
                        确认要从回收站中<span v-if="!moreDelOperate"> <span class="clr_red strong f16">删除患者【{{ delObj.patient_name
                        }}】</span>的<span class="clr_red strong f16">检查编号【{{ delObj.accession_number
}}】</span>的</span>影像吗？删除后影像将不可恢复！
                    </div>
                    <div class="pb10" style="border-bottom: 1px dashed #cccccc;" v-else>确认要删除影像吗？</div>

                </div>
                <span slot="footer" class="dialog-footer">
                    <el-button size="small" @click="handleClose">取消</el-button>
                    <el-button size="small" type="primary" @click="handleSure">确定</el-button>
                </span>
            </el-dialog>
        </div>
        <el-dialog v-el-drag-dialog title="" :visible.sync="delingDailog" width="320px" :before-close="handleDelingClose"
            class="delingDialog">
            <div>
                <div class="mt10 mb10 f20"><i class=" icon iconTrans inline iconfont  clr_ef8900 ">&#xe821;</i> <span
                        class="f16 clr_ef8900">影像删除中</span></div>
                <div class="f14 mb10" v-if="!moreDelOperate">患者姓名：{{ delObj.patient_name }}</div>
                <div class="f14 mb10" v-if="!moreDelOperate">检查编号：{{ delObj.accession_number }}</div>
            </div>
        </el-dialog>

    </div>
</template>
<script>
import Vue from 'vue'
import JSEncrypt from 'jsencrypt'
import HeadNav from "@/components/common/HeadNav"; // 头部导航
import ConditionInquery from './components/ConditionInquery' // 查询条件
import CommonTable from '@/components/common/CommonTable' // 表格
import PaginationTool from '@/components/common/PaginationTool' // 分页
import { recalculateTableHeight } from '@/utils/mixin/filter' // 计算table 高度
// import CustomizedList from '@/components/pacs/commonDialog/CustomizedList' // 自定义列表 弹框
import SetColumns from '@/components/pacs/commonDialog/SetColumns.vue' // 自定义列表 弹框
import moment from 'moment'
import { mapGetters } from 'vuex'
import Mgr from '@/utils/SecurityService'
import store from '@/store/index'
import { getConfigurations } from '@/api/Public.js'

export default {
    name: 'RecycleList',
    data() {
        return {
            BacsUrl: configUrl.frontEndUrl, // configUrl.frontEndUrl,,
            owner: 'archiveManage-studyList',
            SetColumndShow: false,
            TranspondImgShow: false,
            // TranspondData:'',
            tableHeight: 0,
            tableHeighth: "calc(100vh - 520px)",
            currentTableChecked: [], // 表格当中选中的行
            propData: [
                {
                    prop: 'id',
                    label: '检查主键',
                    width: 100
                },
                {
                    prop: 'other_patient_name',
                    label: '患者姓名',
                    width: 120,
                    formatter: function (row) {
                        let name = '';
                        name = row.other_patient_name ? row.other_patient_name : row.patient_name;
                        return name;
                    }
                },
                {
                    prop: 'patient_id',
                    label: '患者编号',
                    width: 160
                },
                {
                    prop: 'patient_sex',
                    label: '性别',
                    width: 50,
                    formatter: function (row) {
                        const sexMapping = {
                            M: '男',
                            F: '女',
                            O: '未知'
                        }
                        return sexMapping[row.patient_sex]
                    }
                },
                {
                    prop: 'patient_age',
                    label: '年龄',
                    width: 60,
                    formatter: function (row) {
                        const patient_ageTypeMapping = {
                            'Y': '岁',
                            'M': '月',
                            'D': '日',
                            'W': '周'
                        }
                        let patient_ageNum = ''
                        let patient_ageType = ''
                        if (row.patient_age) {
                            patient_ageNum = row.patient_age.substring(0, row.patient_age.length - 1)
                            patient_ageType = row.patient_age.substring(row.patient_age.length - 1, row.patient_age.length)
                            return patient_ageNum + patient_ageTypeMapping[patient_ageType]
                        } else {
                            return ''
                        }
                    }
                },
                {
                    prop: 'patient_birth_date',
                    label: '出生日期',
                    width: 160,
                    formatter: function (row) {
                        if (row.patient_birth_date) {
                            return moment(row.patient_birth_date).format('YYYY-MM-DD')
                        } else {
                            return ''
                        }
                    }
                },
                {
                    prop: 'exam_item',
                    label: '检查项目',
                    width: 130
                },
                {
                    prop: 'modalities_in_study',
                    label: '检查类型',
                    width: 80
                },
                {
                    prop: 'accession_number',
                    label: '检查编号',
                    width: 100
                },
                {
                    prop: 'study_date_time',
                    label: '检查时间',
                    width: 160,
                    formatter: function (row) {
                        if (row.study_date_time) {
                            return moment(row.study_date_time).format('YYYY-MM-DD HH:mm:ss')
                        } else {
                            return ''
                        }
                    }
                },
                {
                    prop: 'study_description',
                    label: '检查描述',
                    width: 100
                },
                {
                    prop: 'source_aet',
                    label: '来源设备',
                    width: 120
                },
                {
                    prop: 'observation_room_name',
                    label: '来源机房',
                    width: 120
                },
                {
                    prop: 'storage_state',
                    label: '访问状态',
                    width: 80,
                    formatter: function (row) {
                        if (row.storage_state === 0 || row.storage_state === -10) {
                            return '在线'
                        } else if (row.storage_state === 10) {
                            return '近线'
                        } else if (row.storage_state === 20) {
                            return '远线'
                        } else if (row.storage_state === -1) {
                            return '离线'
                        } else {
                            return ''
                        }
                    }
                },
                {
                    prop: 'volume_label',
                    label: '备份标卷',
                    width: 100
                },
                {
                    prop: 'system_name',
                    label: '系统名称',
                    width: 100
                },
                {
                    prop: 'institution_name',
                    label: '机构名称',
                    width: 100
                }
            ], // table表格原始表头数据
            tableData: [],
            defaultColumn: [
                { owner: 'archiveManage-studyList', field_code: 'id', field_name: '检查主键', column_width: 100, essential: 1, visibility: 1, fixed: 0, sort: 1 },
                { owner: 'archiveManage-studyList', field_code: 'patient_name', field_name: '患者姓名', column_width: 120, essential: 1, visibility: 1, fixed: 0, sort: 2 },
                { owner: 'archiveManage-studyList', field_code: 'patient_id', field_name: '患者编号', column_width: 160, essential: 1, visibility: 1, fixed: 0, sort: 3 },
                { owner: 'archiveManage-studyList', field_code: 'patient_sex', field_name: '性别', column_width: 50, essential: 1, visibility: 1, fixed: 0, sort: 4 },
                { owner: 'archiveManage-studyList', field_code: 'patient_age', field_name: '年龄', column_width: 60, essential: 1, visibility: 1, fixed: 0, sort: 5 },
                { owner: 'archiveManage-studyList', field_code: 'patient_birth_date', field_name: '出生日期', column_width: 160, essential: 1, visibility: 1, fixed: 0, sort: 6 },
                { owner: 'archiveManage-studyList', field_code: 'exam_item', field_name: '检查项目', column_width: 130, essential: 1, visibility: 1, fixed: 0, sort: 7 },
                { owner: 'archiveManage-studyList', field_code: 'modalities_in_study', field_name: '检查类型', column_width: 80, essential: 1, visibility: 1, fixed: 0, sort: 8 },
                { owner: 'archiveManage-studyList', field_code: 'accession_number', field_name: '检查编号', column_width: 100, essential: 1, visibility: 1, fixed: 0, sort: 9 },
                { owner: 'archiveManage-studyList', field_code: 'study_date_time', field_name: '检查时间', column_width: 160, essential: 1, visibility: 1, fixed: 0, sort: 10 },
                { owner: 'archiveManage-studyList', field_code: 'study_description', field_name: '检查描述', column_width: 100, essential: 1, visibility: 1, fixed: 0, sort: 11 },
                { owner: 'archiveManage-studyList', field_code: 'source_aet', field_name: '来源设备', column_width: 120, essential: 1, visibility: 1, fixed: 0, sort: 12 },
                { owner: 'archiveManage-studyList', field_code: 'observation_room_name', field_name: '来源机房', column_width: 120, essential: 1, visibility: 1, fixed: 0, sort: 13 },
                { owner: 'archiveManage-studyList', field_code: 'storage_state', field_name: '访问状态', column_width: 80, essential: 1, visibility: 1, fixed: 0, sort: 14 },
                { owner: 'archiveManage-studyList', field_code: 'volume_label', field_name: '备份标卷', column_width: 100, essential: 1, visibility: 1, fixed: 0, sort: 15 },
                { owner: 'archiveManage-studyList', field_code: 'system_name', field_name: '系统名称', column_width: 100, essential: 1, visibility: 1, fixed: 0, sort: 16 },
                { owner: 'archiveManage-studyList', field_code: 'institution_name', field_name: '机构名称', column_width: 100, essential: 1, visibility: 1, fixed: 0, sort: 17 }
            ],
            importDialogShow: false,
            // allFilesCount: 0,
            // didUploadFilesCount: 0,
            // progressShow: false,
            imgModifyShow: false,
            sendImgShow: false,
            exchangeShow: false,
            TranspondDatas: [],//要转发的数据
            sendImgData: [], // 要发送的数据
            exchangeData: [], // 要交换的数据
            // customizedListShow: false,
            // currentRightCheckedData: [], // 当前自定义列表显示内容
            listQuery: {
                page_index: 1,
                page_size: 10
            },
            formData: { match_state: '' },
            total: 10000,
            rowId: 0,
            dialogType: '', // 弹窗的类型: 查看view 修改modify
            currentRow: null, // 表格当前点击的行
            series_count: 0, // 序列数
            images_count: 0, // 实例数
            seriesData: [],
            baseUrl: '',
            SystemId: '',
            InstitutionId: '',
            pathUrl: '',
            systemsLiteList: [], // 系统名称
            accession_number: '',
            study_instance_uid: '',
            delingDailog: false,
            delDailog: false,
            moreDelOperate: false,
            delId: '',
            delObj: {},
            profile: {
                name: ''
            },
            currentSystemClass: '',
            ObservationRoomIds: [],
            selectedSeries: [],
            match_fail_count: 0,
            clear_select: false,
            importSystemId: '',
            importInstitutionId: '',
            defaultSystemAndInstitutionId: {
                systemId: '',
                institutionId: '',
            }
        }
    },
    mixins: [recalculateTableHeight],
    mounted() {
        this.basePath = process.env.NODE_ENV === 'development' ? '' : '/paservice'

        this.getDefaultSystemIdAndInstitutionId()
        this.currentSystemClass = sessionStorage.getItem('currentSystemClass') || ''
        this.profile = JSON.parse(this.loginInfo)?.profile
        this.pathUrl = process.env.NODE_ENV === 'development' ? '' : '/paservice'
        this.baseUrl = process.env.NODE_ENV === 'development' ? 'http://www.eworlds.com.cn' : configUrl.frontEndUrl
        if (this.$route.query.institution_id) {
            store.commit('permission/SET_DEPTINSTITUTIONID', this.$route.query.institution_id)
        }

        if (this.$route.query.ObservationRoomIds) {
            this.ObservationRoomIds = JSON.parse(this.$route.query.ObservationRoomIds)
        }

        if (this.$route.query?.showMatchFailed) {
            this.formData.match_state = -1
        }
        if (this.scope && this.scope === 'institution' && this.systemid) {
            // 本地取得institution
            // this.getUserInfo()
            this.SystemId = this.systemid
            this.InstitutionId = this.deptInstitutionId
        } else if (this.scope && this.scope === 'system' && this.systemid) {
            this.SystemId = this.systemid
        }
        // this.currentRightCheckedData = this.propData // 复制一份
        if (this.currentSystemClass === 'NMIS') {
            this.propData = [...this.defaultColumn.map(e => ({ ...e, prop: e.field_code, label: e.field_name, width: e.column_width }))]
        } else {
            this.getColumnCustom()
        }
        this.getSystemsLiteList() // 获取系统名称
        this.getConfigurationsFn()

        this.importSystemId = this.SystemId
        this.importInstitutionId = this.InstitutionId

    },

    created() {

        if (this.group === 'tenancy') {
            this.tableHeighth = 'calc(100vh - 310px)'
        } else {
            this.tableHeighth = 'calc(100vh - 270px)'
        }
    },
    computed: {
        orderNum() {
            if (this.listQuery.page_index === 1) {
                return 0
            } else {
                return (this.listQuery.page_index - 1) * this.listQuery.page_size
            }
        },
        ...mapGetters(['group', 'permissions', 'permissionsMapping', 'systemid', 'scope', 'deptInstitutionId', 'exchangeState','loginInfo'])
    },
    watch: {


    },
    methods: {
        getRowKey(row) {
            return row.id
        },
        imgShow(item) {
            item.isDelImgShow = true;
        },
        imgHide(item) {
            item.isDelImgShow = false;
        },
        // 是否有权限
        hasPerimission(permissionName) {
            if (this.group === 'tenancy') {
                return true
            }
            return this.permissions.includes(permissionName)
        },
        toImgList() {

            this.$router.push({ path: this.basePath + '/IMGLIST', query: { group: this.group, systemid: this.$route.query.systemid } })

        },
       
       
        SetColumndBack(val) {
            this.$refs.mytable.doLayout()

            this.SetColumndShow = false
            if (val) {
                this.getColumnCustom()
            }
        },
        // 获取自定义列
        getColumnCustom() {
            var _this = this
            var data = {
                owner: _this.owner,
                platformService: 4
            }
            _this.$pacsApi.pacsApi.getColumnCustom(data).then(res => {
                var Arr = []
                var NewArr = []
                if (res.code === 0) {
                    Arr = res.data.length === 0 ? this.defaultColumn : res.data
                    let sortArr = Arr.sort((a, b) => {
                        return a.sort - b.sort
                    })
                    sortArr.forEach(item => {
                        if (item.visibility) {
                            item.prop = item.field_code
                            item.label = item.field_name
                            item.width = item.column_width
                            if (item.field_code === 'patient_sex') {
                                item.formatter = function (row) {
                                    const sexMapping = {
                                        M: '男',
                                        F: '女',
                                        O: '未知'
                                    }
                                    return sexMapping[row.patient_sex]
                                }
                            } else if (item.field_code === 'patient_age') {
                                item.formatter = function (row) {
                                    const patient_ageTypeMapping = {
                                        'Y': '岁',
                                        'M': '月',
                                        'D': '日',
                                        'W': '周'
                                    }
                                    let patient_ageNum = ''
                                    let patient_ageType = ''
                                    if (row.patient_age) {
                                        patient_ageNum = row.patient_age.substring(0, row.patient_age.length - 1)
                                        patient_ageType = row.patient_age.substring(row.patient_age.length - 1, row.patient_age.length)
                                        return patient_ageNum + patient_ageTypeMapping[patient_ageType]
                                    } else {
                                        return ''
                                    }
                                }
                            } else if (item.field_code === 'patient_birth_date') {
                                item.formatter = function (row) {
                                    if (row.patient_birth_date) {
                                        return moment(row.patient_birth_date).format('YYYY-MM-DD')
                                    } else {
                                        return ''
                                    }
                                }
                            } else if (item.field_code === 'study_date_time') {
                                item.formatter = function (row) {
                                    if (row.study_date_time) {
                                        return moment(row.study_date_time).format('YYYY-MM-DD HH:mm:ss')
                                    } else {
                                        return ''
                                    }
                                }
                            } else if (item.field_code === 'storage_state') {
                                item.formatter = function (row) {
                                    if (row.storage_state === 0 || row.storage_state === -10) {
                                        return '在线'
                                    } else if (row.storage_state === 10) {
                                        return '近线'
                                    } else if (row.storage_state === 20) {
                                        return '远线'
                                    } else if (row.storage_state === -1) {
                                        return '离线'
                                    } else {
                                        return ''
                                    }
                                }
                            }
                            NewArr.push(item)
                        }
                    })
                    _this.propData = NewArr
                    // _this.getRecycledIMGList()
                } else {
                    _this.$message.error(res.msg)
                }
            })
        },

        closeSession() {
            this.currentTableChecked = []
            this.$nextTick(() => {
                this.$refs.mytable.clearSelection()
            })
        },
        singleDeleteFn(row) {
            this.delId = row.id
            this.delObj = row
            this.currentTableChecked = [row]
            this.moreDelOperate = false
            this.delDailog = true
        },

        deleteFn() {

            if (this.currentTableChecked.length === 0) {
                this.$message({
                    showClose: true,
                    message: '请选择要删除的内容',
                    type: 'warning'
                })
                return
            } 
            this.moreDelOperate = true
            this.delDailog = true
        },
        async handleSure() {
            let ids = this.currentTableChecked.map(e => e.id)
            this.deleteRecycleImg(ids)
            this.delDailog = false
            this.closeSession()

        },
        handleDelingClose() {
            this.delingDailog = false;
        },
        handleClose() {
            this.delDailog = false
            this.delSeqObjs = []
        },
        async getConfigurationsFn() {
            const res = await getConfigurations('TransmissionSecurity.RSA.PublicKey')
            if (res.code === 0) {
                // rsa加密
                Vue.prototype.$getRsaCode = function (str) { // 注册方法
                    const pubKey = res.data// ES6 模板字符串 引用 rsa 公钥
                    const encryptStr = new JSEncrypt()
                    encryptStr.setPublicKey(pubKey) // 设置 加密公钥
                    const data = encryptStr.encrypt(str.toString()) // 进行加密
                    return data
                }
            }
        },
        async deleteRecycleImg(ids) {
            this.delingDailog = true;
            let [res, err] = await this.$pacsApi.pacsApi.deleteRecycledImg(ids)
            if (err) {
                this.delingDailog = false;
                return;
            }

            let { code, msg } = res
            this.delingDailog = false;

            if (code === 0) {
                this.$message({
                    type: 'success',
                    message: msg||'删除成功'
                })
                this.getRecycledIMGList();
            } else {
                this.$message.error(res.msg)
            }
        },

        changeClear() {
            this.clear_select = false
        },

        getDefaultSystemIdAndInstitutionId() {

            const permissionArr = JSON.parse(sessionStorage.getItem('permissionArr')) || []
            this.jgyxlbPermission = permissionArr.some(o => o.code === 'ris_jgyxlb') // 机构
            this.ksyxlbPermission = permissionArr.some(o => o.code === 'ris_ksyxlb') // 系统
            // console.log('当前用户角色以及权限', this.group, this.jgyxlbPermission, this.ksyxlbPermission);
            if (this.group === "dept") {
                // 科室角色
                this.defaultSystemAndInstitutionId.systemId = this.systemid;
                const setObj = JSON.parse(localStorage.getItem('setObj')) || JSON.parse(localStorage.getItem('setPacsObj')) || {}
                if (!this.ksyxlbPermission && this.jgyxlbPermission && setObj?.GeneralCliParameter_WorkInstitutionId) {
                    this.defaultSystemAndInstitutionId.institutionId = setObj.GeneralCliParameter_WorkInstitutionId

                } else {
                    this.defaultSystemAndInstitutionId.institutionId = null
                }

            } else if (this.group === "doct") {
                this.defaultSystemAndInstitutionId.systemId = this.systemid;
                this.defaultSystemAndInstitutionId.institutionId = this.deptInstitutionId;

            }

        },

        async getRecycledIMGList() { // 获取列表
            const data = Object.assign(this.formData, this.listQuery)
            data.system_id = this.SystemId ? this.SystemId : this.formData.system_id
            data.institution_id = this.InstitutionId ? this.InstitutionId : this.formData.institution_id
            this.$pacsApi.pacsApi.getRecycledIMGList(data).then(res => {
                const { code, data, page } = res
                if (code === 0) {
                    this.tableData = data
                    this.total = page.total_count
                    this.$refs.mytable.doLayout()
                }
            })

        },
        async fecthTableData() { // 翻页改变
            this.tableData = []
            this.getRecycledIMGList()
        },
        systemOrInstitutionChanged(params) {
            //搜索条件发生变化
            //主要关注系统以及机构变化==>导入影像
            this.importSystemId = params.system_id
            this.importInstitutionId = params.institution_id


        },
        resetFn() {
            this.clearSelection()
        },
        searchFn(params) { // 搜素

            this.listQuery.page_index = 1 // 重置页数
            this.formData = params
            this.getRecycledIMGList()
            this.series_count = 0
            this.images_count = 0
            this.seriesData = []

            this.importSystemId = params.system_id
            this.importInstitutionId = params.institution_id

        },
        setMatchState(val) {

            this.formData.match_state = val

        },
       
    
        // 表格操作
        handleCurrentChange(val) {
            this.selectedSeries = []
            this.currentRow = val
            // 获取序列信息
            if (this.currentRow) {
                this.accession_number = this.currentRow.accession_number;
                this.study_instance_uid = this.currentRow.study_instance_uid;
            }
        },
        tableSignleSelection(rows, row) {
            // console.log("重新点击",rows);
            this.currentTableChecked = rows
        },
        tableAllSelection(rows) {
            this.currentTableChecked = rows

        },
     
        tableHeaderDragend() {
            this.$refs.mytable.doLayout()
        },
        
        async getSystemsLiteList() {
            let res = await this.$pacsApi.pacsApi.getSystemsLiteList({ type: 1 })
            let { code, data } = res
            if (code === 0) {
                this.systemsLiteList = data
            }
        },

    },
    components: {
        HeadNav,
        ConditionInquery,
        CommonTable,
        PaginationTool,
        SetColumns,
    }
}
</script>
<style lang="less" scoped>
/deep/ .white-head .el-dialog__header {

    background-color: white;
    height: 0px;
    color: #2b354a;



    .el-dialog__headerbtn .el-dialog__close {
        color: #2b354a;

    }
}

.delete-btn {
    &:hover , &:focus ,&.is_active{
        color: #ff6f6f;
    }
}
.content-title {
    font-size: 18px;
    margin-bottom: 10px;

    .iconfont {
        font-size: 18px;
    }

}

.importDialog {
    /deep/ .el-dialog__header {
        padding-left: 0px;
    }

    /deep/ .el-progress-bar__outer {
        height: 15px !important;
    }
}

.icon.iconTrans {
    display: inline-block;
    animation: move 1.5s linear infinite;
    -webkit-animation: move 1.5s linear infinite;
    font-size: 20px !important;
}

@keyframes move {
    100% {
        transform: rotate(360deg);
    }
}


/deep/ .listRoomClass .el-select__tags-text {
    display: inline-block;
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/deep/ .listRoomClass .el-icon-close {
    margin-top: -13px;
    margin-left: -6px;
}

// .el-select {
//    /deep/.el-select__tags {
//      // 解决多个tag卡片溢出隐藏问题
//      overflow: hidden;
//      display: -webkit-box;
//      -webkit-line-clamp: 1;
//      -webkit-box-orient: vertical;
//      .el-tag {
//        // 注意这个inline-block 对卡片溢出隐藏很重要
//        display: inline-block;
//        // 解决单个tag文字过长溢出隐藏问题
//        .el-select__tags-text {
//          display: inline-block;
//          max-width: 70px;
//          overflow: hidden;
//          text-overflow: ellipsis;
//          white-space: nowrap;
//        }

//        .el-icon-close {
//          top: -6px;
//          right: -4px;
//        }
//      }
//    }
//  }
.w180 {
    width: 180px;
}

.bg_000 {
    background-color: #000000;
}

.btnBox {

    // position: absolute;
    // right: 20px;
    // top: 95px;
    // margin-bottom: 20px;
    button {
        width: 70px;
        height: 32px;
        background-color: #fff;
        border: 1px solid #DCDFE6;
        padding: 0;
    }
}

.delingDialog {
    // /deep/ .el-dialog {
    //   margin: auto 50px 50px auto;
    // }

    /deep/ .el-dialog__header {
        background-color: white;
        height: 0px;
    }

    /deep/ .el-dialog__body {
        padding: 10px;
    }
}

.f18i {
    font-size: 18px !important;
}

.f20i {
    font-size: 20px !important;
}

.el-button+.el-button {
    margin-left: 5px;
}

.ml10i {
    margin-left: 10px !important;
}

//   /deep/ .el-table__body tr.current-row>td {
//   // 色值待确定
//   background-color: #0a70b0;
//   color: white;
// }
// /deep/.el-table__fixed .el-table__fixed-body-wrapper{
//   top: 42px !important;
//   // height: 100% !important;  //会有bug  左边序号超过15显示不全 
// }
// /deep/.el-table__row .cell {
//   width: 100% !important;
// }
// /deep/ .el-table .el-table__fixed {
//   height: 100% !important;
// }
// /deep/ .el-table__fixed-body-wrapper .el-table__body{
//   padding-bottom: 8px;//滚动条的高度
// }
.img_box {
    overflow-x: auto;
    display: flex;

    div {
        // height: 200px;
        margin-right: 54px;
        // margin-top: 10px;
        // display: flex;
        // flex-direction: column;
        // justify-content: center;
    }

    // .otherDiv {
    //   height: 180px;
    // }



    /deep/.el-checkbox__input {
        position: absolute;
        top: 188px;
        right: 0;
        /*opacity: 0;*/
    }

    /deep/.el-checkbox__inner {
        width: 20px;
        height: 20px;
    }

    /deep/.el-checkbox__input.is-checked .el-checkbox__inner::after {
        margin-left: 3px;
        transform: rotate(45deg) scale(2)
    }

    /deep/.el-checkbox__inner::after {
        /*去除动画效果*/
        -webkit-transition: none !important;
        -moz-transition: none !important;
        -o-transition: none !important;
        transition: none !important;
    }


}



.imgLoadFail {
    width: 94px;
    height: 90px;
    background: url("../../assets/images/pacs/imgLoadFail.png") no-repeat;
    background-size: 100% 100%;
}

.noImg {
    width: 58px;
    height: 90px;
    background: url("../../assets/images/pacs/noImg.png") no-repeat;
    background-size: 100% 100%;
}

.shouldTransform {
    i {
        display: inline-block;
        // &:hover{
        transform: rotate(180deg);
        //     transition: 2s;
        // }
    }

    //  transform: rotate(180deg);
}

.del_btn {
    position: absolute;
    top: 0px;
    right: -12px;
    cursor: pointer;
    z-index: 10;
}</style>
